home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Leser 19
/
Amiga Plus Leser CD 19.iso
/
Online
/
AmigaTalk
/
intuition
/
GadgetAttrs.st
< prev
next >
Wrap
Text File
|
2002-05-05
|
18KB
|
436 lines
" --------------------------------------------------------------------- "
" GadgetAttrs Class is a Singleton class that allows the user to "
" reference Gadget Attributes without having to remember their actual "
" hexadecimal values. "
""
" The User does NOT need to create one of these, since Intuition Class "
" will instantiate the only needed instance of this Class. See the "
" SetupIntuition.st source file for the method(s) that help the User "
" with this Class. "
""
" EXAMPLE: 'myTag <- intuition getGadgetAttr: #GA_ToggleSelect' "
""
" ALL singleton classes MUST contain the following: "
""
" the methods: isSingleton AND privateSetup AND "
" uniqueInstance Class instance variable. "
" --------------------------------------------------------------------- "
Class GadgetAttributes :Dictionary ! uniqueInstance !
[
isSingleton
^ true
|
privateNew ! newinstance !
newinstance <- super new.
^ newinstance
|
new
^ (self privateSetup)
|
privateInitializeDictionary "Too big for a block."
self at: #GA_Left put: 16r80030001.
self at: #GA_RelRight put: 16r80030002.
self at: #GA_Top put: 16r80030003.
self at: #GA_RelBottom put: 16r80030004.
self at: #GA_Width put: 16r80030005.
self at: #GA_RelWidth put: 16r80030006.
self at: #GA_Height put: 16r80030007.
self at: #GA_RelHeight put: 16r80030008.
self at: #GA_Text put: 16r80030009.
self at: #GA_Image put: 16r8003000A.
self at: #GA_Border put: 16r8003000B.
self at: #GA_SelectRender put: 16r8003000C.
self at: #GA_Highlight put: 16r8003000D.
self at: #GA_Disabled put: 16r8003000E.
self at: #GA_GZZGadget put: 16r8003000F.
self at: #GA_ID put: 16r80030010.
self at: #GA_UserData put: 16r80030011.
self at: #GA_SpecialInfo put: 16r80030012.
self at: #GA_Selected put: 16r80030013.
self at: #GA_EndGadget put: 16r80030014.
self at: #GA_Immediate put: 16r80030015.
self at: #GA_RelVerify put: 16r80030016.
self at: #GA_FollowMouse put: 16r80030017.
self at: #GA_RightBorder put: 16r80030018.
self at: #GA_LeftBorder put: 16r80030019.
self at: #GA_TopBorder put: 16r8003001A.
self at: #GA_BottomBorder put: 16r8003001B.
self at: #GA_ToggleSelect put: 16r8003001C.
self at: #GA_SysGadget put: 16r8003001D.
self at: #GA_SysGType put: 16r8003001E.
self at: #GA_Previous put: 16r8003001F.
self at: #GA_Next put: 16r80030020.
self at: #GA_DrawInfo put: 16r80030021.
self at: #GA_IntuiText put: 16r80030022.
self at: #GA_LabelImage put: 16r80030023.
self at: #GA_TabCycle put: 16r80030024.
self at: #GA_GadgetHelp put: 16r80030025.
self at: #GA_Bounds put: 16r80030026.
self at: #GA_RelSpecial put: 16r80030027.
self at: #GA_TextAttr put: 16r80030028.
self at: #GA_ReadOnly put: 16r80030029.
self at: #GA_Underscore put: 16r8003002A.
self at: #GA_ActivateKey put: 16r8003002B.
self at: #GA_BackFill put: 16r8003002C.
self at: #GA_GadgetHelpText put: 16r8003002D.
self at: #GA_UserInput put: 16r8003002E.
self at: #LAYOUTA_LayoutObj put: 16r80038001.
self at: #LAYOUTA_Spacing put: 16r80038002.
self at: #LAYOUTA_Orientation put: 16r80038003.
self at: #LAYOUTA_ChildMaxWidth put: 16r80038004.
self at: #LAYOUTA_ChildMaxHeight put: 16r80038005.
" String Gadget Attributes: "
self at: #STRINGA_MaxChars put: 16r80032001.
self at: #STRINGA_Buffer put: 16r80032002.
self at: #STRINGA_UndoBuffer put: 16r80032003.
self at: #STRINGA_WorkBuffer put: 16r80032004.
self at: #STRINGA_BufferPos put: 16r80032005.
self at: #STRINGA_DispPos put: 16r80032006.
self at: #STRINGA_AltKeyMap put: 16r80032007.
self at: #STRINGA_Font put: 16r80032008.
self at: #STRINGA_Pens put: 16r80032009.
self at: #STRINGA_ActivePens put: 16r8003200A.
self at: #STRINGA_EditHook put: 16r8003200B.
self at: #STRINGA_EditModes put: 16r8003200C.
self at: #STRINGA_ReplaceMode put: 16r8003200D.
self at: #STRINGA_FixedFieldMode put: 16r8003200E.
self at: #STRINGA_NoFilterMode put: 16r8003200F.
self at: #STRINGA_Justification put: 16r80032010.
self at: #STRINGA_LongVal put: 16r80032011.
self at: #STRINGA_TextVal put: 16r80032012.
self at: #STRINGA_ExitHelp put: 16r80032013.
self at: #LAYOUTA_LayoutObj put: 16r80038001.
self at: #LAYOUTA_Spacing put: 16r80038002.
self at: #LAYOUTA_Orientation put: 16r80038003.
self at: #LAYOUTA_ChildMaxWidth put: 16r80038004.
self at: #LAYOUTA_ChildMaxHeight put: 16r80038005.
" Proportional Gadget Attributes: "
self at: #PGA_Freedom put: 16r80031001.
self at: #PGA_Borderless put: 16r80031002.
self at: #PGA_HorizPot put: 16r80031003.
self at: #PGA_HorizBody put: 16r80031004.
self at: #PGA_VertPot put: 16r80031005.
self at: #PGA_VertBody put: 16r80031006.
self at: #PGA_Total put: 16r80031007.
self at: #PGA_Visible put: 16r80031008.
self at: #PGA_Top put: 16r80031009.
self at: #PGA_NewLook put: 16r8003100A.
|
privateSetup
(uniqueInstance isNil)
ifTrue: [uniqueInstance <- self privateNew.
self privateInitializeDictionary
].
^ self
]
" -------------------------------------------------------------------- "
" GadToolsAttributes Class is a singleton class for the attribute tags "
" associated with GadTools Gadgets & GadTools Menus. "
""
" NOTE: The keys are in Gadget Order, not numerical order in here. "
""
" The User does NOT need to create one of these, since Intuition Class "
" will instantiate the only needed instance of this Class. See the "
" SetupIntuition.st source file for the method(s) that help the User "
" with this Class. "
""
" EXAMPLE: 'myTag <- intuition getGadToolAttr: #GT_Underscore' "
""
" ALL singleton classes MUST contain the following: "
""
" the methods: isSingleton AND privateSetup AND "
" uniqueInstance Class instance variable. "
" -------------------------------------------------------------------- "
Class GadToolsAttributes :Dictionary ! uniqueInstance !
[
isSingleton
^ true
|
privateNew ! newinstance !
newinstance <- super new.
^ newinstance
|
new
^ (self privateSetup)
|
privateInitializeDictionary "Too big for a Block."
"GadTools attributes (1-3, 25-37 reserved):"
"NewMenu Attributes:"
self at: #GTMN_TextAttr put: 16r80080031.
self at: #GTMN_FrontPen put: 16r80080032.
"GTMN_Menu is used internally only!"
self at: #GTMN_Menu put: 16r8008003C.
" Asks CreateMenus() to validate that this is a complete menu structure: "
self at: #GTMN_FullMenu put: 16r8008003E.
" ti_Data is a pointer to ULONG to receive error reports from CreateMenus()"
self at: #GTMN_SecondaryError put: 16r8008003F.
self at: #GTMN_Checkmark put: 16r80080041. " ti_Data is checkmark img to use "
self at: #GTMN_AmigaKey put: 16r80080042. " ti_Data is Amiga-key img to use "
self at: #GTMN_NewLookMenus put: 16r80080043. " ti_Data is boolean "
" ng_Flags control certain aspects of the gadget. The first five control
* the placement of the descriptive text. Each gadget kind has its
* default, which is usually PLACETEXT_LEFT. Consult the autodocs for
* details.
"
self at: #PLACETEXT_LEFT put: 1. " Right-align text on left side "
self at: #PLACETEXT_RIGHT put: 2. " Left-align text on right side "
self at: #PLACETEXT_ABOVE put: 4. " Center text above "
self at: #PLACETEXT_BELOW put: 8. " Center text below "
self at: #PLACETEXT_IN put: 16. " Center text on "
self at: #NG_HIGHLABEL put: 32. " Highlight the label "
" NewMenus tags & flags: "
self at: #NM_TITLE put: 1.
self at: #NM_ITEM put: 2.
self at: #NM_SUB put: 3.
self at: #NM_END put: 0.
self at: #NM_IGNORE put: 64.
self at: #NM_BARLABEL put: -1.
self at: #IM_ITEM put: 130. " Graphical menu item "
self at: #IM_SUB put: 131. " Graphical menu sub-item "
self at: #NM_MENUDISABLED put: 1. " Same as MENU_ENABLED "
self at: #NM_ITEMDISABLED put: 16. " Same as ITEMENABLED "
self at: #NM_COMMANDSTRING put: 4. " Same as COMMSEQ "
self at: #NM_FLAGMASK put: 16r39. "(~(COMMSEQ | ITEMTEXT | HIGHFLAGS))"
self at: #NM_FLAGMASK_V39 put: 16r3D. "(~(ITEMTEXT | HIGHFLAGS))"
" These return codes can be obtained through the GTMN_SecondaryError tag "
" Too many menus, items, or subitems, menu has been trimmed down: "
self at: #GTMENU_TRIMMED put: 1.
self at: #GTMENU_INVALID put: 2. " Invalid NewMenu array "
self at: #GTMENU_NOMEM put: 3. " Out of memory "
"General Gadget Attributes:"
self at: #GT_VisualInfo put: 16r80080034.
self at: #GT_Reserved1 put: 16r80080038.
self at: #GT_Underscore put: 16r80080040.
"String (R/W) Gadget Attributes:"
self at: #GTST_String put: 16r8008002D.
self at: #GTST_MaxChars put: 16r8008002E.
self at: #GTST_EditHook put: 16r80080037.
"Integer (R/W) Gadget Attributes:"
self at: #GTIN_Number put: 16r8008002F.
self at: #GTIN_MaxChars put: 16r80080030.
self at: #GTIN_EditHook put: 16r80080037.
"Text (read-only) Gadget Attributes:"
self at: #GTTX_Text put: 16r8008000B.
self at: #GTTX_CopyText put: 16r8008000C.
self at: #GTTX_Border put: 16r80080039.
self at: #GTTX_FrontPen put: 16r80080048.
self at: #GTTX_BackPen put: 16r80080049.
self at: #GTTX_Justification put: 16r8008004A.
self at: #GTTX_Clipped put: 16r80080055.
"Number (read-only) Gadget Attributes:"
self at: #GTNM_Number put: 16r8008000D.
self at: #GTNM_Border put: 16r8008003A.
self at: #GTNM_FrontPen put: 16r80080048.
self at: #GTNM_BackPen put: 16r80080049.
self at: #GTNM_Justification put: 16r8008004A.
self at: #GTNM_Format put: 16r8008004B.
self at: #GTNM_MaxNumberLen put: 16r8008004C.
self at: #GTNM_Clipped put: 16r80080055.
"ListView Gadget Attributes:"
self at: #GTLV_Top put: 16r80080005.
self at: #GTLV_Labels put: 16r80080006.
self at: #GTLV_ReadOnly put: 16r80080007.
self at: #GTLV_ScrollWidth put: 16r80080008.
self at: #GTLV_ShowSelected put: 16r80080035.
self at: #GTLV_Selected put: 16r80080036.
self at: #GTLV_MakeVisible put: 16r8008004E.
self at: #GTLV_ItemHeight put: 16r8008004F.
self at: #GTLV_CallBack put: 16r80080053.
self at: #GTLV_MaxPen put: 16r80080054.
"CheckBox Gadget Attributes:"
self at: #GTCB_Checked put: 16r80080004.
self at: #GTCB_Scaled put: 16r80080044.
"Radio Button (Mutual Excluded) Gadget Attributes:"
self at: #GTMX_Labels put: 16r80080009.
self at: #GTMX_Active put: 16r8008000A.
self at: #GTMX_Spacing put: 16r8008003D.
self at: #GTMX_Scaled put: 16r80080045.
self at: #GTMX_TitlePlace put: 16r80080047.
"Cycle Gadget Attributes:"
self at: #GTCY_Labels put: 16r8008000E.
self at: #GTCY_Active put: 16r8008000F.
"Palette Gadget Attributes:"
self at: #GTPA_Depth put: 16r80080010.
self at: #GTPA_Color put: 16r80080011.
self at: #GTPA_ColorOffset put: 16r80080012.
self at: #GTPA_IndicatorWidth put: 16r80080013.
self at: #GTPA_IndicatorHeight put: 16r80080014.
self at: #GTPA_NumColors put: 16r80080046.
self at: #GTPA_ColorTable put: 16r80080052.
"Slider (proportional) Gadget Attributes:"
self at: #GTSL_Min put: 16r80080026.
self at: #GTSL_Max put: 16r80080027.
self at: #GTSL_Level put: 16r80080028.
self at: #GTSL_MaxLevelLen put: 16r80080029.
self at: #GTSL_LevelFormat put: 16r8008002A.
self at: #GTSL_LevelPlace put: 16r8008002B.
self at: #GTSL_DispFunc put: 16r8008002C.
self at: #GTSL_MaxPixelLen put: 16r80080050.
self at: #GTSL_Justification put: 16r80080051.
"Scroller Gadget Attributes:"
self at: #GTSC_Top put: 16r80080015.
self at: #GTSC_Total put: 16r80080016.
self at: #GTSC_Visible put: 16r80080017.
self at: #GTSC_Overlap put: 16r80080018.
self at: #GTSC_Arrows put: 16r8008003B.
"BevelBox Attribute(s):"
self at: #GTBB_Recessed put: 16r80080033.
self at: #GTBB_FrameType put: 16r8008004D.
" Bevel box frame types for GTBB_FrameType tag: "
self at: #BBFT_BUTTON put: 1. " Standard button gadget box "
self at: #BBFT_RIDGE put: 2. " Standard string gadget box "
self at: #BBFT_ICONDROPBOX put: 3. " Standard icon drop box "
" Justification types for GTTX_Justification & GTNM_Justification: "
self at: #GTJ_LEFT put: 0.
self at: #GTJ_RIGHT put: 1.
self at: #GTJ_CENTER put: 2.
" The different types of messages that a listview callback hook can see: "
self at: #LV_DRAW put: 16r202. " draw yourself, with state "
" Possible return values from a callback hook: "
self at: #LVCB_OK put: 0. " callback understands this message type "
self at: #LVCB_UNKNOWN put: 1. " callback does not understand this message "
" States for LVDrawMsg.lvdm_State: "
self at: #LVR_NORMAL put: 0. " the usual "
self at: #LVR_SELECTED put: 1. " for selected gadgets "
self at: #LVR_NORMALDISABLED put: 2. " for disabled gadgets "
self at: #LVR_SELECTEDDISABLED put: 8. " disabled and selected "
|
privateSetup
(uniqueInstance isNil)
ifTrue: [uniqueInstance <- self privateNew.
self privateInitializeDictionary
].
^ self "uniqueInstance??"
]
" --------------------------------------------------------------------- "
" GadgetMethodIDs Class is a Singleton class that allows the user to "
" reference Gadget Method IDs without having to remember their actual "
" hexadecimal values. "
""
" The User does NOT need to create one of these, since Intuition Class "
" will instantiate the only needed instance of this Class. See the "
" SetupIntuition.st source file for the method(s) that help the User "
" with this Class. "
""
" EXAMPLE: 'myTag <- intuition getMethodID: #GM_Domain' "
""
" ALL singleton classes MUST contain the following: "
""
" the methods: isSingleton AND privateSetup AND "
" uniqueInstance Class instance variable. "
" --------------------------------------------------------------------- "
Class GadgetMethodIDs :Dictionary ! uniqueInstance !
[
isSingleton
^ true
|
privateNew ! newinstance !
newinstance <- super new.
^ newinstance
|
new
^ (self privateSetup)
|
privateInitializeDictionary "Too big for a block."
self at: #GM_Dummy put: 16rFFFFFFFF.
self at: #GM_HITTEST put: 16r0.
self at: #GM_RENDER put: 16r1.
self at: #GM_GOACTIVE put: 16r2.
self at: #GM_HANDLEINPUT put: 16r3.
self at: #GM_GOINACTIVE put: 16r4.
self at: #GM_HELPTEST put: 16r5.
self at: #GM_LAYOUT put: 16r6.
self at: #GM_DOMAIN put: 16r7.
self at: #GM_KEYTEST put: 16r8.
self at: #GM_KEYGOACTIVE put: 16r9.
self at: #GM_KEYGOINACTIVE put: 16rA.
"For GM_HITTEST:"
self at: #GMR_GADGETHIT put: 16r4.
self at: #GMR_HOHELPHIT put: 0.
self at: #GMR_HELPHIT put: 16rFFFFFFFF.
self at: #GMR_HELPCODE put: 16r00010000.
"For GM_RENDER:"
self at: #GREDRAW_UPDATE put: 16r2.
self at: #GREDRAW_REDRAW put: 1.
self at: #GREDRAW_TOGGLE put: 0.
"For GM_HANDLEINPUT & GM_GOACTIVE:"
self at: #GMR_MEACTIVE put: 0.
self at: #GMR_NOREUSE put: 2.
self at: #GMR_REUSE put: 4.
self at: #GMR_VERIFY put: 8.
self at: #GMR_NEXTACTIVE put: 16r10.
self at: #GMR_PREVACTIVE put: 16r20.
"For GM_DOMAIN:"
self at: #GDOMAIN_MINIMUM put: 0.
self at: #GDOMAIN_NOMINAL put: 1.
self at: #GDOMAIN_MAXIMUM put: 2.
"For GM_KEYGOACTIVE:"
self at: #GMR_KEYACTIVE put: 16r10.
self at: #GMR_KEYVERIFY put: 16r20.
|
privateSetup
(uniqueInstance isNil)
ifTrue: [uniqueInstance <- self privateNew.
self privateInitializeDictionary
].
^ self
]